﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entities;
using System.Data;
using System.Data.SqlClient;
using Entities;


namespace DataAccess
{
   public  class CardDA
    {
       ConnectDB cn = new ConnectDB();
       CardEntites CarE = new CardEntites();
       // thanh
       public void Block()
       { 
       
       }
       // thanh
       public void UnBlock()
       { 
       
       }
       public void SetPIN()
       {
       
       }
       public bool CheckAccountNo(CardEntites carE)
       {
           bool kt = false;
           SqlConnection con = new SqlConnection(cn.ConnectionString());
           con.Open();
           SqlCommand cmd = new SqlCommand("ProCardSelectByCarNo", con);
           cmd.CommandType = CommandType.StoredProcedure;
           cmd.Parameters.Add(new SqlParameter("@CardNo", carE.CardNo));
           SqlDataReader dt = cmd.ExecuteReader();
           if (dt.Read())
           {
               return true;
           }
           else
           {
               return false;
           }
          // cmd.ExecuteNonQuery();
           cmd.Dispose();
           return kt;
       }
     
      
    }
}
